<?php

use Illuminate\Database\Migrations\Migration;
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Support\Facades\Schema;

return new class extends Migration
{
    /**
     * Run the migrations.
     */
    public function up(): void
    {
        Schema::table('tenants', function (Blueprint $table) {
            $table->string('company_name', 200)->nullable()->comment('公司名称')->after('name');
            $table->string('tax_registration_number', 50)->nullable()->comment('税务登记号')->after('company_name');
            $table->string('address', 500)->nullable()->comment('公司地址')->after('tax_registration_number');
            $table->string('bank_name', 200)->nullable()->comment('开户行名称')->after('address');
            $table->string('bank_account', 100)->nullable()->comment('开户行账号')->after('bank_name');
            $table->string('invoice_contact_phone', 50)->nullable()->comment('发票事务联系电话')->after('contact_phone');
            $table->string('invoice_mailing_address', 500)->nullable()->comment('发票邮寄地址')->after('invoice_contact_phone');
            $table->string('invoice_recipient', 100)->nullable()->comment('发票收件人')->after('invoice_mailing_address');
        });
    }

    /**
     * Reverse the migrations.
     */
    public function down(): void
    {
        Schema::table('tenants', function (Blueprint $table) {
            $table->dropColumn([
                'company_name',
                'tax_registration_number',
                'address',
                'bank_name',
                'bank_account',
                'invoice_contact_phone',
                'invoice_mailing_address',
                'invoice_recipient',
            ]);
        });
    }
};
